package models;

import java.util.Arrays;

import akka.actor.*;

public abstract class Player extends UntypedActor {
	protected Karta[] cards;
    public  String name;
    protected int myCash;
    protected int numberOfWin;
	 
    public String getName() {
    	return name;
    }
    protected void updateCards(Karta[] newCards) {
    	int j=0;
    	for (int i = 0; i < 5; i++) {
    		if (cards[i] == null) {
    			cards[i] = newCards[j];
    			j++;
    		}
    	}
    	Arrays.sort(this.cards);
    }
    public final String toString() {
        String tmp = "["+name+"]:";
        for (int i = 0; i < 5; i++) {
            tmp += " " + cards[i];
        }
        return tmp;
    }
    public int getCash() {
    	return myCash;
    }

}